Public Class Config

	Private Sub Config_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

		If InstallDirTextBox.Text <> My.Settings.InstallDir Then
			If MsgBox("you have unsaved changes. are your sure you want to quit?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo) <> MsgBoxResult.Yes Then
				e.Cancel = True
			End If
		End If

	End Sub

	Private Sub Config_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

		InstallDirTextBox.Text = My.Settings.InstallDir

	End Sub

	Private Sub AcceptButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AcceptButton.Click

		My.Settings.InstallDir = InstallDirTextBox.Text
		My.Settings.Save()

	End Sub

	Private Sub BrowseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BrowseButton.Click

		If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
			InstallDirTextBox.Text = OpenFileDialog1.FileName
		End If
	End Sub

	Private Sub CancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CancelButton.Click

		Close()

	End Sub
End Class